package com.code.base.log.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.log.persistence.LogPsnTrdMapper;
import com.code.base.log.pojo.LogPsnTrd;
import com.code.util.PrimaryKeyUtil;


@Service
public class LogPsnTrdService {


	@Resource
	private LogPsnTrdMapper logPsnTrdMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public LogPsnTrd getDataById(Long id) {
		return logPsnTrdMapper.getDataById(id);
	}

	public List<LogPsnTrd> getAllData() {
		return logPsnTrdMapper.getAllData();
	}

	public int getDataCountByCondition(LogPsnTrd entity) {
		return logPsnTrdMapper.getDataCountByCondition(entity);
	}

	public List<LogPsnTrd> getDataByCondition(LogPsnTrd entity) {
		return logPsnTrdMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(LogPsnTrd entity) {
		return logPsnTrdMapper.getDataCountByLikeCondition(entity);
	}

	public List<LogPsnTrd> getDataByLikeCondition(LogPsnTrd entity) {
		return logPsnTrdMapper.getDataByLikeCondition(entity);
	}

	public List<LogPsnTrd> getDataByIds(Long[] ids) {
		return logPsnTrdMapper.getDataByIds(ids);
	}

	public void insertData(LogPsnTrd entity) {
		insertData(entity, true);
	}

	public void insertData(LogPsnTrd entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		logPsnTrdMapper.insertData(entity);
	}

	public void updateData(LogPsnTrd entity) {
		logPsnTrdMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		logPsnTrdMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(LogPsnTrd entity) {
		logPsnTrdMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		logPsnTrdMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		logPsnTrdMapper.deleteDataByIds(ids);
	}

}
